import fetch from './fetch'

// 订单标的列表
export function querySubject(params) {
	return fetch({
		url: 'CrmBusiness/querySubject',
		method: 'post',
		params
	})
}
// 订单人员列表
export function queryPerson({ id, type, insurance_type }) {
	return fetch({
		url: 'CrmBusiness/queryPerson',
		method: 'post',
		params: { bussinessId: id, id, type, insurance_type }
	})
}
// 订单人员表头
export function queryField(params) {
	return fetch({
		url: 'CrmContract/queryTargetField',
		method: 'post',
		params
	})
}
// 核保保存
export function saveUnderwrite(data) {
	return fetch({
		url: 'CrmBusiness/underwriting',
		method: 'post',
		data,
		headers: {
			'Content-Type': 'application/json;charset=UTF-8'
		}
	})
}
// 支付信息
export function queryStep4(params) {
	return fetch({
		url: 'CrmBusiness/queryStep4',
		method: 'post',
		params
	})
}
// 保存支付凭证
export function saveVoucher(data) {
	return fetch({
		url: 'CrmBusiness/saveVoucher',
		method: 'post',
		data,
		headers: {
			'Content-Type': 'application/json;charset=UTF-8'
		}
	})
}
// 提交电子盖章投保书
export function saveAndSignature(data, params) {
	return fetch({
		url: 'insurance/insure/saveAndSignature',
		method: 'post',
		data,
		params,
		headers: {
			'Content-Type': 'application/json'
		}
	})
}
// 电子签章验证码
export function sendSignSMSCode(mobile, params) {
	return fetch({
		url: 'insurance/insure/sendSignSMSCode',
		method: 'post',
		data: { mobile },
		params,
		headers: {
			'Content-Type': 'application/json'
		}
	})
}
// 获取盖章信息
export function getSignatures(businessId) {
	return fetch({
		url: 'insurance/insure/getSignatures',
		method: 'get',
		params: { businessId }
	})
}
// 待签文件列表
export function getDocList(params) {
	return fetch({
		url: 'CrmBusiness/queryStep3Stamp',
		method: 'post',
		params
	})
}
// 签章操作
export function signature(data, params) {
	return fetch({
		url: 'insurance/insure/signature',
		method: 'post',
		data,
		params,
		headers: {
			'Content-Type': 'application/json'
		}
	})
}

// 核验签章
export function signSaveAndCheck(data, params) {
	return fetch({
		url: 'insurance/insure/saveAndCheck',
		method: 'post',
		data,
		params,
		headers: {
			'Content-Type': 'application/json'
		}
	})
}
// 提交手动盖章投保书
export function printSeal(data, params) {
	return fetch({
		url: 'insurance/insure/printSeal',
		method: 'post',
		data,
		params,
		headers: {
			'Content-Type': 'application/json'
		}
	})
}
